<template>
    <div class="goodsdesc-container">
        <h3 class="title">{{ goodsdesc.title }}</h3>

        <hr>

        <div class="content" v-html="goodsdesc.content"></div>
    </div>
</template>

<script>
    import {Toast} from 'mint-ui'
    export default{
        data(){
            return {
                id:this.$route.params.id,
                goodsdesc:{}//商品的图文介绍
            }
        },
        created(){
            this.getGoodsDesc();
        },
        methods:{
            getGoodsDesc(id){
                this.axios
                .get("api/goods/getdesc/" + this.id)
                .then(result=>{
                    if(result.data.status === 0){
                        this.goodsdesc = result.data.message[0]
                    }else{
                        Toast("获取图文介绍失败");
                    }
                })
            }
        }
    }
</script>

<style lang="scss" >
.goodsdesc-container{
    padding:4px;
    .title{
        font-size:16px;
        color:#226aff;
        text-align:center;
        margin:15px 0;
    }
    .content{
        img{
            width:100%;
        }
    }
}
</style>